<template>
  <div v-show="flag" class="msg">
      <div class="box">
          <span :class="className">
              {{ text }}
          </span>
      </div>
  </div>
</template>

<script>
export default {
    data() {
        return {
            flag: false,
            text: "",
            className: ""
        }
    }
}
</script>

<style scoped>
.msg {
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, .4);
}

.box {
    width: 200px;
    height: 80px;
    background: #fff;
    margin-left: 85px;
    margin-top: 100px;
    text-align: center;
    line-height: 80px;
}

.success {
    color: green;
}

.warning {
    color: orange;
}

.error {
    color: red;
}
</style>